﻿<%@ Page Title="الاشتراكات" Language="C#" MasterPageFile="~/MainMaster.master" AutoEventWireup="true" CodeFile="Subscriptions.aspx.cs" Inherits="Subscriptions" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <link href="jqModal.css" rel="stylesheet" type="text/css" />

 <%--   <script src="jquery-1.3.2.min.js" type="text/javascript"></script>--%>
    <script src="jqModal.js" type="text/javascript"></script>
    <script type="text/javascript">

    function there() {

        $("#dialog").jqm({ modal: true }).jqmShow();


    }
    
      </script>
      <style type="text/css">
          .newzr3{
	background:  url('images/Untitled-2_03.png') right ;

	height:34px;
	 background-repeat:no-repeat;
	 float:left;
	 margin-top:-5px;
	 text-align: center;
	 padding-right:15px;
	 cursor:pointer;
	 font-family:Tahoma;
	 font-size:14px;
	 color:#003353;
	 text-decoration:none;
	 
}
.newzr3:hover{
	color: #00b4ff;
	background-image:url('images/Untitled-2ho_03.png');
	background-repeat:no-repeat;

}
          .zr3 {
	background-image:url('images/button2.png');
	display:block;
	float:right;
	 padding: 0px 10px 0px 10px;
	height:21px;
	text-align:center;
	color:#fff;
	text-shadow:1px 1px 0px #003a5e;
	margin-right:2px;
	line-height:19px;
	font-weight:bold;
	text-decoration:none;
	font-family:Tahoma;
	font-size:12px;


}
.zr3:hover ,.zr3:active {
	background-image:url('images/button2.png');
	text-shadow:1px 1px 0px #003a5e;
	background-position:0px -21px;
	
}
  .stylelabel3
       {
       	color:#064c66;
	 font-weight:bold;
	 direction:rtl;
	 text-align:right;
       	}
             .tab3{
	width:815px;
 direction:rtl;
 border:1px #ccc solid;
 border-radius:5px;
 }

tr .tabbone3{
	 background-color:#028ac5;
	 font-size:11px;
	 line-height:20px;
	 font-family:Tahoma;
  	 color:#fff;
  	 text-align:center;
	
}
 .req3
       {
           color:Red;
       } 
.adel3{
	background-color:#ededed;
	font-size:10px;
	color:#084f86;
	font-family:Tahoma;
	height:30px;
	text-align:  center;
}
.he3{
	background-color:#fff;
	padding:5px;
	font-family:Tahoma;
	font-size:14px;
	font-weight:bold;
}
        .jqmWindow {
    display: none;
    
    position: fixed;
    top: 30%;
    left: 50%;
    
    margin-left: -300px;
    width: 400px;
    
    background-color: #fff;
    color: #333;
    border: 1px solid black;
    padding: 12px;
}
.txt3
{
    border:1px solid black;
    margin-bottom:5px;
    margin-top:5px;
    }
.jqmOverlay { background-color: #000; }

/* Fixed posistioning emulation for IE6
     Star selector used to hide definition from browsers other than IE6
     For valid CSS, use a conditional include instead */
* html .jqmWindow 
{
     position: absolute;
     top: expression((document.documentElement.scrollTop || document.body.scrollTop) + Math.round(17 * (document.documentElement.offsetHeight || document.body.clientHeight) / 100) + 'px');
}
            </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <br />
    <div id="selects" runat="server"  align="center"> 
    <table class="tab3">
    <tr>
    <td class="tabbone3">
    <asp:Label ID="comapnaynamelabel" runat="server" Text="اسم الجهة" 
            meta:resourcekey="comapnaynamelabelResource1"></asp:Label>
    </td>
    </tr><tr>
    <td class="adel3">
<asp:DropDownList ID="currentsubs" runat="server" style="border:1px solid black" 
            DataSourceID="SqlDataSource2" DataTextField="company"
        DataValueField="id" AutoPostBack="True" 
        onselectedindexchanged="currentsubs_SelectedIndexChanged" 
            AppendDataBoundItems="True" meta:resourcekey="currentsubsResource1">
        <asp:ListItem Value="0" meta:resourcekey="ListItemResource1">--</asp:ListItem>
    </asp:DropDownList>
    </td>
    </tr>
    </table>
 <br />
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="select company ,id from companies ">
        </asp:SqlDataSource>
</div>

   <div id="addedit" runat="server">
   <table style="width:100%">
   <tr>
   <td >
       <asp:LinkButton CssClass="newzr3" runat="server" 
           style="float:left;margin-left:5px" Text="اشتراك جديد"  
        meta:resourceKey="newsub" Height="19px"  onclick="newsub_Click"></asp:LinkButton>
   </td>
   </tr>
   </table>
</div>
    

<div class="jqmWindow" id="dialog">

<a href="#" class="jqmClose" style="background-image:url('images/close.png');
	 width:39px;
	 height:40px;
	  background-repeat:no-repeat;
	  display:block;
	  float:left;	"></a>
     <table  dir="rtl">
     
     <tr>
     <td align="right">
         <asp:Label CssClass="stylelabel3"  ID="lblpaidfees" runat="server" Text="قيمة الاشتراك" meta:resourceKey="lblpaidfees" />
    </td>
  <td>
     <asp:TextBox ID="paidfees" runat="server" CssClass="txt3" width="150px" 
          meta:resourcekey="paidfeesResource1"></asp:TextBox>
 </td>
 <td> 
       &nbsp;</td>
   
             <td> 
                 &nbsp;</td>
             </tr><tr>
             <td align="right">
 <asp:Label CssClass="stylelabel3"  ID="lblsatrtsub" runat="server" Text="بداية الاشتراك" meta:resourceKey="lblsatrtsub" />
     </td>
      <td>
        <eo:datepicker ID="DatePicker1" runat="server" DayHeaderFormat="Full" 
               DayCellHeight="16" DisabledDates="" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
                                    OtherMonthDayVisible="True" DayCellWidth="19" TitleRightArrowImageUrl="DefaultSubMenuIcon"
                                    ControlSkinID="None" SelectedDates=""  width="150px" 
              meta:resourcekey="DatePicker1Resource1">
                                    <DayHoverStyle CssText="font-family: tahoma; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid">
                                    </DayHoverStyle>
                                    <TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;">
                                    </TitleStyle>
                                    <DayHeaderStyle CssText="font-family: tahoma; font-size: 12px; border-bottom: #aca899 1px solid">
                                    </DayHeaderStyle>
                                    <DayStyle CssText="font-family: tahoma; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid">
                                    </DayStyle>
                                    <SelectedDayStyle CssText="font-family: tahoma; font-size: 12px; background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid">
                                    </SelectedDayStyle>
                                    <TitleArrowStyle CssText="cursor:hand"></TitleArrowStyle>
                                    <TodayStyle CssText="font-family: tahoma; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid">
                                    </TodayStyle>
                                    <PickerStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;font-family:Courier New;font-size:8pt;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;">
                                    </PickerStyle>
                                    <OtherMonthDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid">
                                    </OtherMonthDayStyle>
                                    <CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma">
                                    </CalendarStyle>
                                    <DisabledDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid">
                                    </DisabledDayStyle>
                                    <MonthStyle CssText="font-family: tahoma; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px">
                                    </MonthStyle>
                                </eo:datepicker>
      </td>
       <td>
           &nbsp;</td>
      <td>
          &nbsp;</td></tr>
          <tr>
          <td align="right">
 <asp:Label CssClass="stylelabel3"  ID="lblendsub" runat="server" Text="نهاية الاشتراك" meta:resourceKey="lblendsub" />
              </td>
          <td> 
       <eo:datepicker ID="DatePicker2" runat="server" DayHeaderFormat="Full"  width="150px"
              DayCellHeight="16" DisabledDates="" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
                                    OtherMonthDayVisible="True" DayCellWidth="19" TitleRightArrowImageUrl="DefaultSubMenuIcon"
                                    ControlSkinID="None" SelectedDates="" 
                  meta:resourcekey="DatePicker2Resource1" >
                                    <DayHoverStyle CssText="font-family: tahoma; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid">
                                    </DayHoverStyle>
                                    <TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;">
                                    </TitleStyle>
                                    <DayHeaderStyle CssText="font-family: tahoma; font-size: 12px; border-bottom: #aca899 1px solid">
                                    </DayHeaderStyle>
                                    <DayStyle CssText="font-family: tahoma; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid">
                                    </DayStyle>
                                    <SelectedDayStyle CssText="font-family: tahoma; font-size: 12px; background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid">
                                    </SelectedDayStyle>
                                    <TitleArrowStyle CssText="cursor:hand"></TitleArrowStyle>
                                    <TodayStyle CssText="font-family: tahoma; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid">
                                    </TodayStyle>
                                    <PickerStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;font-family:Courier New;font-size:8pt;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;">
                                    </PickerStyle>
                                    <OtherMonthDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid">
                                    </OtherMonthDayStyle>
                                    <CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma">
                                    </CalendarStyle>
                                    <DisabledDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid">
                                    </DisabledDayStyle>
                                    <MonthStyle CssText="font-family: tahoma; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px">
                                    </MonthStyle>
                                </eo:datepicker>
              </td>
          <td></td>
          <td></td>
          </tr>
          <tr>
          <td> 
              &nbsp;</td>
          <td> 
     <asp:Button   CssClass="zr3" ID="save" runat="server" Text="حفظ" onclick="save_Click" meta:resourceKey="lblsave"  />
              </td>
          <td></td>
          <td></td>
          </tr>
          </table></div>
     
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT [company_id], [startofsub], [endofsub], [paidfees], [id]  FROM [subscriptions] WHERE ([company_id] = @company_id)">
         <SelectParameters>
            <asp:Parameter Name="company_id" />
        </SelectParameters>
       <%-- <SelectParameters>
            <asp:QueryStringParameter Name="company_id" QueryStringField="company" 
                Type="Int32" />
        </SelectParameters>--%>
    </asp:SqlDataSource>
    
  <%--  
    <asp:UpdatePanel ID="up1" runat="server" ChildrenAsTriggers="true">
    <ContentTemplate>
   --%>
    <asp:GridView ID="GridView1" runat="server" 
        DataSourceID="SqlDataSource1" 
        AutoGenerateColumns="False" DataKeyNames="id" 
        onrowdatabound="GridView1_RowDataBound" 
    onrowcreated="GridView1_RowCreated1" GridLines="None" 
        EnableModelValidation="True" meta:resourcekey="GridView1Resource1">
        <Columns>
        
        
                <asp:TemplateField meta:resourcekey="TemplateFieldResource1">
                            <HeaderTemplate>
                            <div >
                                <table  class="tab3">
                                    <tr>
                                     <td class="tabbone3" style="width:200px">
                                        <asp:Label ID="lblpaidfees" runat="server" Text="النقود المدفوعة" meta:resourceKey="lblpaidfees" />
                                            
                                        </td>

                                        <td class="tabbone3" style="width:200px">
                                     <asp:Label ID="lblstartofsubs" runat="server" Text="بداية الاشتراك" meta:resourceKey="lblstartofsubs" />
                                            
                                        </td>
                                         <td class="tabbone3"style="width:200px">
                                     <asp:Label ID="lblendofsubs" runat="server" Text="نهاية الاشتراك" meta:resourceKey="lblendofsubs" />
                                        </td>
                                    <td class="tabbone3"style="width:200px">
                                     <asp:Label  ID="lblstops" runat="server" Text="سارى/منتهى" meta:resourceKey="lblstop" />
                                        </td>
                                    </tr>
                                </table>
                                </div>
                            </HeaderTemplate>
                            <ItemTemplate>
                              
                             
                                    <table class="tab3" >
                                        <tr>
                                         <td class="adel3" style="width:200px">
                                                <asp:Label  ID="paidfees" runat="server" 
                                                    Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("paidfees"))) %>' 
                                                    meta:resourcekey="paidfeesResource2" />
                                            </td>
                                            <td class="adel3" style="width:200px">
                                                <asp:Label  ID="startofsub" runat="server" 
                                                    Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("startofsub"))) %>' 
                                                    meta:resourcekey="startofsubResource1" />
                                            </td>
                                            <td class="adel3" style="width:200px">
                                                <asp:Label ID="endofsub" runat="server" Text='<%# Eval("endofsub") %>' 
                                                    meta:resourcekey="endofsubResource1" />
                                            </td>
                                            <td class="adel3"style="width:200px">
                                             <asp:LinkButton runat="server" ID="edits" Text='تعديل' meta:resourceKey="lbledit"  
                                                    ToolTip='<%# Eval("id") %>' OnClick="edit_Click" Enabled="False" />
                                            </td>
                                                                                       
                                        </tr>
                                    </table>
                                    </ItemTemplate>
                </asp:TemplateField>
      
        </Columns>
    </asp:GridView>
    <%-- </ContentTemplate>
    </asp:UpdatePanel>--%>
</asp:Content>